import 'package:flutter/cupertino.dart';
import 'package:json_annotation/json_annotation.dart';

part 'message_template.g.dart';

//    文本消息 TEXT("MS:TEXT"),
//    图片消息 IMAGE("MS:IMAGE"),
//    文件消息 FILE("MS:FILE"),
//    位置消息 LOCATION("MS:LOCATION"),
//    视频消息 VIDEO("MS:VIDEO"),
//    语音消息 VOICE("MS:VOICE");
@JsonSerializable()
class THMessageTemplate {
  /// 消息类型
  int type;

  /// 消息内容
  String content;

  String toUserId;

  String fromUserId;

  String userId;

  THMessageTemplate(
      {@required this.type,
      @required this.toUserId,
      @required this.fromUserId,
      @required this.userId,
      @required this.content});

  factory THMessageTemplate.fromJson(Map<String, dynamic> json) =>
      _$THMessageTemplateFromJson(json);

  Map<String, dynamic> toJson() => _$THMessageTemplateToJson(this);
}
